package org.gruposp2p.proyectokarma.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.AbstractAuthenticationEvent;
import org.springframework.security.authentication.event.AuthenticationSuccessEvent;
import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent;
import org.springframework.security.authentication.event.InteractiveAuthenticationSuccessEvent;
import org.springframework.security.web.authentication.switchuser.AuthenticationSwitchUserEvent;

public class SecurityEventListener implements ApplicationListener<AbstractAuthenticationEvent> {
	
    private static Logger logger =
    	LoggerFactory.getLogger(SecurityEventListener.class);

	@Override
	public void onApplicationEvent(AbstractAuthenticationEvent event) {
		//logger.debug("event.getClass(): " + event.getClass());
		if (event instanceof AuthenticationSuccessEvent) {
		} else if (event instanceof AbstractAuthenticationFailureEvent) {
		} else if (event instanceof InteractiveAuthenticationSuccessEvent) { } 
		else if (event instanceof AuthenticationSwitchUserEvent) { }

	}
	
}





